package com.gutsyzhan.yusiailangchain4j.assistant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;

@AiService(wiringMode = AiServiceWiringMode.EXPLICIT,
        chatModel = "ollamaChatModel", chatMemoryProvider = "chatMemoryProvider",
        tools = "mathTools"
)
public interface SeparateChatAssistant {
    /**
     * 分离聊天记录
     * @param memoryId 聊天id
     * @param userMessage 用户消息
     */
    @SystemMessage("你是我的好朋友，请用四川话回答问题。今天是{{current_date}}")
    String chat(@MemoryId int memoryId , @UserMessage String userMessage);

    @SystemMessage(fromResource = "prompts/assistant.txt")
    String chatFromResource(@MemoryId int memoryId , @UserMessage String userMessage);

    @UserMessage("你是我的好朋友，请用四川话回答问题。我的名字叫：{{myName}}")
    String chatUser(@MemoryId int memoryId, @V("myName")String userMessage);

    @SystemMessage(fromResource = "prompts/assistantV1.txt")
    String chatComplex(@MemoryId int memoryId, @UserMessage String userMessage,
                       @V("username")String userName, @V("age")int age);

    @SystemMessage("你是我的好朋友，请用四川话回答问题。")
    String chatTool(@MemoryId int memoryId , @UserMessage String userMessage);
}
